#include <vector>
#include <iostream>
using namespace std;

void bubble_sort(vector<int> &v){
  for (int j=0; j < v.size()-1; j++ ){

   for (int s=0; s < v.size(); s++){
   cout << v[s] << " ";
   }
   cout << endl;

    for (int i=j+1; i < v.size(); i++){
     if (v[j] > v[i]){
     int t=0;
     t=v[i];
     v[i]=v[j];
     v[j]=t;
    }
   }
  }
 }

int main (int argc, char ** argu){

 vector <int> v;
 vector <int> numbers;
 int j;

 while (1) {
  cout << "число" << endl;
  cin >>j;
  if (0==j) break;
  v.push_back(j);
 }

 for (int i=0; i < v.size(); i++){
  int a = -1;
  for (int q=0; q < numbers.size(); q++){
   if (v[i]==numbers[q])
    a = q;
  }
   if(a== -1){
   numbers.push_back(v[i]);
   }
 }
  
  bubble_sort(numbers);

  for (int j=0; j < numbers.size(); j++){
  cout << numbers[j] << " ";
  }

 return 0;
}


